<template>
  <el-config-provider namespace="el">
    <div>
      <!-- <router-view /> -->
      <router-view v-slot="{ Component }">
        <keep-alive>
          <component :is="Component" />
        </keep-alive>
      </router-view>
    </div>
  </el-config-provider>
</template>

<script setup>
import {  watch, getCurrentInstance } from 'vue'
const { proxy } = getCurrentInstance()

// 监听路由
watch(
  () => proxy.$router.currentRoute.value,
  (newValue) => {
    console.log(newValue)
    newValue.meta && newValue.meta.title && (document.title = newValue.meta.title)
  },
  { immediate: true }
)
</script>
